package org.nuonuo.sdk.model.base;

import org.nuonuo.sdk.model.callback.content.*;
import org.nuonuo.sdk.model.res.*;

/**
 * @Version 1.0
 * @Author az
 * @Date 2024-03-28 10:30:30
 * @ClassName NMethod
 * @Description
 */
public enum NMethod {

    /////////////////          开票           /////////////////

    /** nuonuo.OpeMplatform.requestBillingNew（诺税通saas请求开具发票接口） */
    REQUEST_BILLING_NEW("nuonuo.OpeMplatform.requestBillingNew", BillingNewRes.class, "诺税通saas请求开具发票接口"),

    /** nuonuo.OpeMplatform.queryInvoiceResult（开票结果查询接口） */
    QUERY_INVOICE_RESULT("nuonuo.OpeMplatform.queryInvoiceResult",InvoiceRes.class, "开票结果查询接口"),

    /** nuonuo.OpeMplatform.reInvoice（诺税通saas开票重试接口） */
    RE_INVOICE("nuonuo.OpeMplatform.reInvoice", RetrySignatureRes.class, "诺税通saas开票重试接口"),

    /** callback 回传开票结果接口 */
    INVOICE_ISSUE_CALLBACK("callback", IssueContent.class, "发票开票回调"),
    /////////////////          开票          /////////////////

    /*********************************************************************************/

    /////////////////          红冲          /////////////////

    /** nuonuo.OpeMplatform.saveInvoiceRedConfirm（诺税通saas红字确认单申请接口） */
    INVOICE_RED_CONFIRM("nuonuo.OpeMplatform.saveInvoiceRedConfirm", InvoiceRedRes.class, "诺税通saas红字确认单申请接口"),

    /** nuonuo.OpeMplatform.queryInvoiceRedConfirm（诺税通saas红字确认单查询接口） */
    QUERY_INVOICE_RED_CONFIRM("nuonuo.OpeMplatform.queryInvoiceRedConfirm", InvoiceRedConfirmRes.class, "诺税通saas红字确认单查询接口"),

    /** nuonuo.OpeMplatform.fastInvoiceRed（诺税通saas发票快捷冲红接口） */
    FAST_INVOICE_RED("nuonuo.OpeMplatform.fastInvoiceRed", BillingNewRes.class, "诺税通saas发票快捷冲红接口"),

    /** confirmCallback-回传红字信息表申请结果接口 */
    INVOICE_RED_CONFIRM_CALLBACK("confirmCallback", InvoiceRedConfirmItem.class, "红字信息表申请结果回调接口"),

//    INVOICE_RED_CONFIRM_CALLBACK("confirmCallback", InvoiceRedConfirmContent.class, "红字信息表申请结果回调接口"),

    /*INVOICE_RED_CALLBACK("invoiceRedCallback", InvoiceRedContent.class, "发票红冲回调"),*/
    /////////////////          红冲          /////////////////

    /*********************************************************************************/

    /////////////////          其他          /////////////////

    RETRY_SIGNATURE("nuonuo.OpeMplatform.retrySignature", RetrySignatureRes.class, "诺税通saas发票签章重试接口"),
    INVOICE_CANCELLATION("nuonuo.OpeMplatform.invoiceCancellation", InvoiceCancellationRes.class, "诺税通saas发票作废接口"),
    BLANK_INVOICE_INVALIDATE("nuonuo.OpeMplatform.blankInvoiceInvalidate", BlankInvoiceInvalidateRes.class, "诺税通saas空白发票作废"),
    GET_PDF("nuonuo.OpeMplatform.getPDF", InvoicePdfRes.class, "诺税通saas获取电子发票PDF地址接口"),
    OPEN_INVOICE("nuonuo.OpeMplatform.sj", OpenInvoiceRes.class, "电子收据开具接口"),
    INVALID_INVOICE("nuonuo.OpeMplatform.invalidElectronic", InvalidInvoiceRes.class, "作废电子收据接口"),
    INVOICE_APPLY_CALLBACK("invoiceApply", null, "开票申请回调"),
    INVOICE_INVALID_CALLBACK("invoiceInvalid", InvalidContent.class, "发票作废回调"),

    ;
    private final String value;
    private final Class clazz;
    private final String label;
    NMethod(String value, Class clazz, String label) {
        this.value = value;
        this.clazz = clazz;
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public Class getClazz() {
        return clazz;
    }

   public static NMethod getMethod(String value) {
        if (value == null) return null;

       NMethod[] methods = values();
       for (int i = 0, j = methods.length; i < j; i++) {
           if (methods[i].getValue().equals(value)) return methods[i];
       }
       return null;
    }
}
